#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n;
    int sum = 0;
    int i;
    scanf("%d", &n);
    while (n > 0)
    {
        i = n % 10;
        n /= 10;
        sum += i;
    }
    printf("%d", sum);
    return 0;
}